<template>
  <div >
    <div>
      <div class="font15 mt10 pl10">
      <span class="titletext ">{{titledata.title}}</span>
      <div class="graytext  mt10 font13">
        <span >工单编号：</span>
        <span class="titletext">{{titledata.pmInsId}}</span>
      </div>
    </div>
    <!-- 基本信息 -->
    <div class="mt10" style=" display: flex;border-bottom: 1px solid #ebedf0;">
      <div class="blue_item" />
      <span class="font15" style="display: flex; line-height: 33px;margin-left:5px;  flex:1;">基础信息</span> 
    </div>
    <van-field readonly required name="city" :value="fromdata.city" label-width="3em" label="地市：" />
    <van-field readonly required name="counties" :value="fromdata.counties" label-width="3em" label="县区：" />
    <van-field readonly required name="projectID" :value="fromdata.projectID" label-width="5em" label="项目编号：" />
    <van-field readonly required name="projectName" :value="fromdata.projectName" label-width="5em" label="项目名称：" />
    <van-field readonly required name="competitiveMode" :value="fromdata.competitiveMode" label-width="7em" label="项目竞争方式：" />
    <van-field readonly required name="projectServiceContent" :value="fromdata.projectServiceContent" label="项目实施类型:" label-width="7em" />
    <van-field v-if="fromdata.competitiveMode=='直签'" readonly required name="renewVal" :value="fromdata.renew==true?'是':'否'" label-width="8em" label="是否为续约项目：" />
    <van-field v-if="fromdata.competitiveMode=='直签'" readonly name="parentProjectID" :value="fromdata.parentProjectID" label-width="7em" label="往期项目编码：" />
    <van-field readonly required name="customerId" :value="fromdata.customerId" label-width="5em" label="客户编码：" />
    <van-field readonly required name="customerUnitName" :value="fromdata.customerUnitName" label-width="5em" label="客户名称：" />
    <van-field v-if="fromdata.competitiveMode=='直签'" readonly required name="partnerType" :value="fromdata.partnerType" label-width="5em" label="合作类型：" />
    <van-field v-if="fromdata.competitiveMode=='直签'" readonly name="projectDescription" :value="fromdata.projectDescription" label-width="5em" label="项目描述：" />
    <van-field v-if="fromdata.competitiveMode=='直签'" readonly required name="projectDecisionTime" :value="fromdata.projectDecisionTime" label-width="7em" label="立标决策时间：" />
    <van-field readonly required label-width="8em" label="立项决策呈批件：" />
    <div v-for="(fileitem) in fromdata.projectDecisionDocument" :key="fileitem.id" style="margin-left:20px">
      <div readonly class="font14 fileLink" style="color:#0F85CF">
        <a target="_blank" @click="openFileUrlfun(fileitem.anonymousFilePath)">{{ fileitem.fileName }}</a>
      </div>
    </div>
    <van-field readonly v-if="fromdata.competitiveMode=='直签'" required name="experienceReview" :value="fromdata.experienceReview" label-width="5em" label="经验复盘：" />
    <van-field readonly v-if="fromdata.competitiveMode=='直签'" required name="reviewTime" :value="fromdata.reviewTime" label-width="5em" label="复盘时间：" />
    <van-field readonly required label-width="9em" label="技术方案附件文件：" />
    <div v-for="(fileitem) in fromdata.technologyDocument" :key="fileitem.id" style="margin-left:20px">
      <div readonly class="font14 fileLink" style="color:#0F85CF">
        <a target="_blank" @click="openFileUrlfun(fileitem.anonymousFilePath)">{{ fileitem.fileName }}</a>
      </div>
    </div>
    <van-field readonly required label-width="12em" label="前向合同签约扫描件文件：" />
    <div v-for="(fileitem) in fromdata.oldContractDocument" :key="fileitem.id" style="margin-left:20px">
      <div readonly class="font14 fileLink" style="color:#0F85CF">
        <a target="_blank" @click="openFileUrlfun(fileitem.anonymousFilePath)">{{ fileitem.fileName }}</a>
      </div>
    </div>
    <div v-if="aiDataResult&&aiDataResult.resultData">
      <ai-el-table :aiDataResult="aiDataResult"></ai-el-table>
    </div>
    <div class="mt10" style=" display: flex;border-bottom: 1px solid #ebedf0;">
      <div class="blue_item" />
      <span class="font15" style="display: flex; line-height: 33px;margin-left:5px;  flex:1;">承办环节</span> 
    </div>
    <van-field readonly required name="receiveUnit" :value="fromdata.receiveUnit" label-width="5em" label="承办单位：" />
    <van-field readonly required name="receiveDepartment" :value="fromdata.receiveDepartment" label-width="5em" label="承办部门：" />
    <historyAndSuggs id='target' :showHistory='showHistory'
            :historydata='historydata' :approveList='approveList' />
    </div>
    
   
  </div>
</template>
 
<script>
import { openFileUrl } from '@/store/openFile'
import historyAndSuggs from "@/views/srqr/historyAndSuggs.vue"
import aiElTable from "@/components/aiElTable/index.vue";
export default {
  data() {
    return {
    }
  },
  props: ['titledata','businessdata','fromdata','showHistory','historydata','approveList','aiDataResult'],
  methods: {
     tomsg () {
      document.getElementById('target').scrollIntoView({ behavior: 'smooth' })
    },
    openFileUrlfun(value) {
      this.$router.push(
        {
          name: 'fileview',
          query: {
            openFileUrl: openFileUrl(value)
          }
        }
      );
    },
  },
  components: {
    aiElTable,
    historyAndSuggs
  },
}
</script>
 
<style>
.tables.el-table .cell {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    word-break: break-all;
    line-height: 15px;
    padding-left: 5px;
    padding-right: 5px;
}
</style>